<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>计算按钮的单击次数</title>
</head>
<body>
<form action="" name="form1">
    <input type="button" name="myButton" value="Button clicked 0 items">
</form>
<script>
    var myButton = document.form1.myButton;
    var numberOfClicks = 0;
    myButton.addEventListener('click', myButtonClick);

    function myButtonClick(e) {
        numberOfClicks++;
        myButton.value = 'Button clicked ' + numberOfClicks + ' items';
    }
</script>
</body>
</html>